
export function confirmmsg(that, deletesingle, ID, freshpage, querydata, msg) { // msg是非必填项
  const showmsg = msg || '此操作将永久删除该记录, 是否继续?'
  // 确认是否删除
  that.$confirm(showmsg, '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(async() => {
    const res = await deletesingle(ID)
    console.log('message封装收到的删除结果：', res)
    if (res.code === '200') {
      that.$message({
        type: 'success',
        message: '删除成功!'
      })
      freshpage(querydata) // 刷新页面
    } else {
      that.$message({
        type: 'info',
        message: '删除失败'
      })
    }
  }).catch(() => {
    // that.$message({
    //   type: 'info',
    //   message: '已取消删除'
    // })
  })
}

